﻿using Dev.DevNet.Common.Utility;
using Dev.DevNet.IServices.DevSystem;
using Microsoft.AspNetCore.Mvc;



namespace Dev.DevNet.WebAPI
{
    /// <summary>
    /// 用户vpi
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class DevUserController : ControllerBase
    {
        private readonly IDevUserInfoService _IDevUserInfoService;
        public DevUserController(IDevUserInfoService iDevUserInfoService)
        {
            _IDevUserInfoService = iDevUserInfoService;
        }
        /// <summary>
        /// 查询用户
        /// </summary>
        [HttpGet("getuserbyId")]
        public IActionResult GetUserById(int Id)
        {
          var user=  _IDevUserInfoService.QueryWhere(a => a.Id == Id).First();

            return Content(JsonUtility.SerializeObject(user));

        }
        // GET: api/<DevUserController>
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/<DevUserController>/5
        [HttpGet("{id}")]
        public string Get(int id)
        {
            return "value";
        }

        // POST api/<DevUserController>
        [HttpPost]
        public void Post([FromBody] string value)
        {
        }

        // PUT api/<DevUserController>/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }

        // DELETE api/<DevUserController>/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }
}
